package com.springboot.spring01ioc.dao;

import com.springboot.spring01ioc.bean.Dog;
import lombok.ToString;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Repository;

@Repository
@ToString
public class UserDao {
    Dog dahuang;

    //构造器注入：Spring自动调用  构造器需要的所有参数的组件值


    /*public UserDao(Dog dog){
        System.out.println("UserDao.....有参构造器");
        this.dahuang = dog;
    }*/


    /*@Autowired
    public void setDog(@Qualifier("dog02") Dog dog){
        System.out.println("setDog..." + dog);
        this.dahuang = dog;
    }*/
}
